import {Injectable} from '@angular/core';
import {JwtHelperService} from '@auth0/angular-jwt';

@Injectable()
export class UserService {

  constructor(private jwtHelper: JwtHelperService) {
  }

  isOnline(): boolean {
    if (!this.jwtHelper.tokenGetter()) {
      return false;
    }
    return !this.jwtHelper.isTokenExpired();
  }

}
